package user;


import operation.*;

import java.util.Scanner;

/**
 * 管理员
 */
public class AdminUser extends User{

    public AdminUser(String name) {
        super(name);

        this.iOperations = new IOperation[] {
                new Exit(),
                new Add(),
                new Delete(),
                new Find(),
                new Modify(),
                new Display(),
        };

    }

    public int menu() {
        System.out.println("*********************************");
        System.out.println("hello "+this.getName()+" 欢迎来到图书小练习！");
        System.out.println("*********************************");
        System.out.println("1、增添图书     2、删除图书");
        System.out.println("3、查找图书     4、修改图书");
        System.out.println("5、显示图书     0、退出系统");
        System.out.println("*********************************");

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你的选择:>");
        int choice = scanner.nextInt();

        while(choice <0 || choice>=6) {
            System.out.println("输入错误，请重新选择！");
            System.out.println("请输入你的选择:>");
            choice = scanner.nextInt();
        }
        return choice;

    }
}
